package com.yvan.serverless.jdbc;

import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.Map;

@Component
public class TimestampConvert implements DaoResultConvert {

    @Override
    public boolean isMatch(Map<String, Object> entity, String field, Object value) {
        return (value instanceof Timestamp);
    }

    @Override
    public Object transform(Map<String, Object> entity, String field, Object value) {
        return ((Timestamp) value).getTime();
    }
}
